package apis

import (
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
	"github.com/go-admin-team/go-admin-core/sdk/api"
	"tuowei.com/app/admin/service"
	"tuowei.com/app/admin/service/dto"
)

type SysKuaiDi struct {
	api.Api
}
type KuaiDiS struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

func (e SysKuaiDi) GetList(c *gin.Context) {
	s := service.SysConsultLBT{}
	req := dto.SysConsultLBTInsertReq{}
	err := e.MakeContext(c).
		MakeOrm().
		Bind(&req, binding.JSON).
		MakeService(&s.Service).
		Errors
	if err != nil {
		e.Logger.Error(err)
		e.Error(500, err, err.Error())
		return
	}
	e.OK(KuaiDi(), "查询成功")
}
func KuaiDi() interface{} {
	kd := make([]KuaiDiS, 0)
	k1 := KuaiDiS{
		Name: "申通快递",
		Code: "shentong",
	}
	kd = append(kd, k1)
	k2 := KuaiDiS{
		Name: "中通快递",
		Code: "zhongtong",
	}
	kd = append(kd, k2)
	k3 := KuaiDiS{
		Name: "顺丰速运",
		Code: "shunfeng",
	}
	kd = append(kd, k3)
	k4 := KuaiDiS{
		Name: "德邦快递",
		Code: "debangkuaidi",
	}
	kd = append(kd, k4)
	k5 := KuaiDiS{
		Name: "极兔速递",
		Code: "jtexpress",
	}
	kd = append(kd, k5)

	k6 := KuaiDiS{
		Name: "京东物流",
		Code: "jd",
	}
	kd = append(kd, k6)
	k7 := KuaiDiS{
		Name: "EMS",
		Code: "ems",
	}
	kd = append(kd, k7)

	k8 := KuaiDiS{
		Name: "圆通速递",
		Code: "yuantong",
	}
	kd = append(kd, k8)
	k9 := KuaiDiS{
		Name: "韵达快递",
		Code: "yunda",
	}
	kd = append(kd, k9)
	k10 := KuaiDiS{
		Name: "天天快递",
		Code: "tiantian",
	}
	kd = append(kd, k10)
	return kd
}
